package com.strive.user.config;

import com.strive.common.config.DefaultPasswordConfig;
import com.strive.common.utils.PwdEncoderUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @description:
 * @author: bingcun.chen
 * @Date: 2022/3/7 18:31
 * @Version 1.0
 */
@Configuration
public class PasswordConfig extends DefaultPasswordConfig {
    @Bean
    @ConditionalOnMissingBean
    public PasswordEncoder passwordEncoder() {
        return PwdEncoderUtil.getDelegatingPasswordEncoder("bcrypt");
    }
}
